# 初始化数据库
import sys
sys.path.append('./')
from utils.db_util import async_engine
from models.mysql_model import Base
from models.mysql_model import Apps

async def init_db():
    async with async_engine.begin() as conn:
        await conn.run_sync(
            lambda _: Base.metadata.create_all(
            bind=_,
            # tables=[App.__table__]    #  不要table 全部创建
        ))


if __name__ == '__main__':
    import asyncio
    asyncio.run(init_db())